/**
 * Created by Administrator on 2017/5/8.
 */

var url = window.location.search
var theRequest = {}
if (url.indexOf('?') > -1) {
  var str = url.substr(1)
  var strs = str.split('&')
  for (var i = 0; i < strs.length; i++) {
    var sTemp = strs[i].split('=')
    if (sTemp[1]) {
      theRequest[sTemp[0]] = decodeURI(sTemp[1])
    }
  }
}

export default {
  querys: theRequest,
  getRandom (a, b) {
    return Math.random() * (b - a) + a
  },
  getZ (num) {
    var rounded
    rounded = (0.5 + num) | 0
    // A double bitwise not.
    rounded = ~~(0.5 + num)
    // Finally, a left bitwise shift.
    rounded = (0.5 + num) << 0
    return rounded
  }
}
